//
//  MyDisabledTextButton.cpp
//  CanYouDoIt
//
//  Created by hoangtx on 7/14/13.
//
//

#include "MyDisabledTextButton.h"


bool MyDisabledTextButton::init(){
    MyDisabledButton::init();

    return true;
}

MyDisabledTextButton* MyDisabledTextButton::create(const char *fileName, double mX, double mY, double mWidth, double mHeight){
    MyDisabledTextButton* button = MyDisabledTextButton::create();
    button->setPosition(ccp(mX,mY));
    button->buttonSize = CCSizeMake(mWidth, mHeight);
    button->sprite = CCSprite::create(fileName);
    button->sprite->setAnchorPoint(ccp(0,0));
    button->sprite->setScaleX(mWidth/button->sprite->getContentSize().width);
    button->sprite->setScaleY(mHeight/button->sprite->getContentSize().height);
    button->sprite->setPosition(ccp(0,0));
    button->sprite->setColor(button->normalColor);
    button->addChild(button->sprite);
    button->label = CCLabelBMFont::create("1", "Info.fnt");
    button->label->setAnchorPoint(ccp(0.5,0.5));
    button->label->setPosition(mWidth/2,mHeight/2);
    button->label->setScale(button->buttonSize.height*0.6f/button->label->getContentSize().height);
    button->addChild(button->label);
    return button;
}

